.class Lcom/trademob/tracking/TMRequestProcessor;
.super Ljava/lang/Object;
.source "TMRequestProcessor.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;
    }
.end annotation


# instance fields
.field private myFailedUrlCount:I

.field private myLastURLScheduleTime:J

.field private volatile myOldRequests:Ljava/util/Vector;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Vector",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private volatile myRequests:Ljava/util/Vector;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Vector",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private volatile myRunningRequests:Ljava/util/Vector;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Vector",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private myTask:Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;

.field private myTaskSet:Z

.field private myTimer:Ljava/util/Timer;

.field private final myUtility:Lcom/trademob/tracking/TMUtility;

.field private final myWebView:Landroid/webkit/WebView;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 5
    .parameter "aContext"

    .prologue
    const/4 v4, 0x0

    .line 41
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 43
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    .line 44
    .local v1, bufferedContext:Landroid/content/Context;
    new-instance v2, Landroid/webkit/WebView;

    invoke-direct {v2, v1}, Landroid/webkit/WebView;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myWebView:Landroid/webkit/WebView;

    .line 45
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myWebView:Landroid/webkit/WebView;

    invoke-virtual {v2}, Landroid/webkit/WebView;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v2

    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/webkit/WebSettings;->setJavaScriptEnabled(Z)V

    .line 46
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myWebView:Landroid/webkit/WebView;

    new-instance v3, Lcom/trademob/tracking/TMRequestProcessor$1;

    invoke-direct {v3, p0}, Lcom/trademob/tracking/TMRequestProcessor$1;-><init>(Lcom/trademob/tracking/TMRequestProcessor;)V

    invoke-virtual {v2, v3}, Landroid/webkit/WebView;->setWebViewClient(Landroid/webkit/WebViewClient;)V

    .line 60
    new-instance v2, Lcom/trademob/tracking/TMUtility;

    invoke-direct {v2, v1}, Lcom/trademob/tracking/TMUtility;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myUtility:Lcom/trademob/tracking/TMUtility;

    .line 61
    new-instance v2, Ljava/util/Vector;

    invoke-direct {v2}, Ljava/util/Vector;-><init>()V

    iput-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    .line 62
    new-instance v2, Ljava/util/Vector;

    invoke-direct {v2}, Ljava/util/Vector;-><init>()V

    iput-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRunningRequests:Ljava/util/Vector;

    .line 63
    new-instance v2, Ljava/util/Vector;

    invoke-direct {v2}, Ljava/util/Vector;-><init>()V

    iput-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    .line 64
    new-instance v2, Ljava/util/Timer;

    invoke-direct {v2}, Ljava/util/Timer;-><init>()V

    iput-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    .line 65
    new-instance v2, Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;

    const/4 v3, 0x0

    invoke-direct {v2, p0, v3}, Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;-><init>(Lcom/trademob/tracking/TMRequestProcessor;Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;)V

    iput-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTask:Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;

    .line 66
    iput-boolean v4, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTaskSet:Z

    .line 67
    iput v4, p0, Lcom/trademob/tracking/TMRequestProcessor;->myFailedUrlCount:I

    .line 68
    const-wide/16 v2, 0x0

    iput-wide v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myLastURLScheduleTime:J

    .line 70
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myUtility:Lcom/trademob/tracking/TMUtility;

    const-string v3, "TMPersistedURLS"

    invoke-virtual {v2, v3}, Lcom/trademob/tracking/TMUtility;->restoreStringVector(Ljava/lang/String;)Ljava/util/Vector;

    move-result-object v0

    .line 72
    .local v0, buffer:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    invoke-virtual {v0}, Ljava/util/Vector;->isEmpty()Z

    move-result v2

    if-nez v2, :cond_0

    .line 74
    iput-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    .line 75
    invoke-virtual {p0}, Lcom/trademob/tracking/TMRequestProcessor;->runNextUrl()V

    .line 77
    :cond_0
    return-void
.end method

.method static synthetic access$0(Lcom/trademob/tracking/TMRequestProcessor;)Ljava/util/Vector;
    .locals 1
    .parameter

    .prologue
    .line 20
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    return-object v0
.end method

.method static synthetic access$1(Lcom/trademob/tracking/TMRequestProcessor;Z)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 32
    iput-boolean p1, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTaskSet:Z

    return-void
.end method

.method static synthetic access$2(Lcom/trademob/tracking/TMRequestProcessor;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 266
    invoke-direct {p0, p1}, Lcom/trademob/tracking/TMRequestProcessor;->notFinishedLoadForUrl(Ljava/lang/String;)V

    return-void
.end method

.method static synthetic access$3(Lcom/trademob/tracking/TMRequestProcessor;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 301
    invoke-direct {p0, p1}, Lcom/trademob/tracking/TMRequestProcessor;->finishedLoadForUrl(Ljava/lang/String;)V

    return-void
.end method

.method static synthetic access$4(Lcom/trademob/tracking/TMRequestProcessor;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 235
    invoke-direct {p0, p1}, Lcom/trademob/tracking/TMRequestProcessor;->removeUrl(Ljava/lang/String;)V

    return-void
.end method

.method static synthetic access$5(Lcom/trademob/tracking/TMRequestProcessor;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 245
    invoke-direct {p0, p1}, Lcom/trademob/tracking/TMRequestProcessor;->addRunningUrl(Ljava/lang/String;)V

    return-void
.end method

.method static synthetic access$6(Lcom/trademob/tracking/TMRequestProcessor;)Landroid/webkit/WebView;
    .locals 1
    .parameter

    .prologue
    .line 18
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myWebView:Landroid/webkit/WebView;

    return-object v0
.end method

.method private addRunningUrl(Ljava/lang/String;)V
    .locals 1
    .parameter "aURL"

    .prologue
    .line 247
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRunningRequests:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 248
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->saveUrls()V

    .line 249
    return-void
.end method

.method private addUrl(Ljava/lang/String;)V
    .locals 2
    .parameter "aURL"

    .prologue
    .line 224
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->totalRequestCount()I

    move-result v0

    const/16 v1, 0x32

    if-ge v0, v1, :cond_0

    .line 226
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 227
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->saveUrls()V

    .line 229
    :cond_0
    return-void
.end method

.method private declared-synchronized cancelTask()V
    .locals 4

    .prologue
    .line 202
    monitor-enter p0

    :try_start_0
    iget-boolean v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTaskSet:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v2, :cond_0

    .line 206
    :try_start_1
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    invoke-virtual {v2}, Ljava/util/Timer;->cancel()V

    .line 207
    const/4 v2, 0x0

    iput-boolean v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTaskSet:Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 216
    :cond_0
    :goto_0
    monitor-exit p0

    return-void

    .line 209
    :catch_0
    move-exception v0

    .line 211
    .local v0, e:Ljava/lang/Exception;
    :try_start_2
    new-instance v1, Lcom/trademob/tracking/TMErrorTracker;

    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myUtility:Lcom/trademob/tracking/TMUtility;

    invoke-direct {v1, v2}, Lcom/trademob/tracking/TMErrorTracker;-><init>(Lcom/trademob/tracking/TMUtility;)V

    .line 212
    .local v1, et:Lcom/trademob/tracking/TMErrorTracker;
    const-string v2, "TMRequestProcessor.cancelTask"

    const-string v3, "no-params"

    invoke-virtual {v1, v0, v2, v3}, Lcom/trademob/tracking/TMErrorTracker;->addStandardData(Ljava/lang/Exception;Ljava/lang/String;Ljava/lang/String;)V

    .line 213
    invoke-virtual {v1}, Lcom/trademob/tracking/TMErrorTracker;->sendErrorData()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_0

    .line 202
    .end local v0           #e:Ljava/lang/Exception;
    .end local v1           #et:Lcom/trademob/tracking/TMErrorTracker;
    :catchall_0
    move-exception v2

    monitor-exit p0

    throw v2
.end method

.method private finishedLoadForUrl(Ljava/lang/String;)V
    .locals 0
    .parameter "aURL"

    .prologue
    .line 303
    invoke-direct {p0, p1}, Lcom/trademob/tracking/TMRequestProcessor;->removeRunningUrl(Ljava/lang/String;)V

    .line 304
    invoke-virtual {p0}, Lcom/trademob/tracking/TMRequestProcessor;->runNextUrl()V

    .line 305
    return-void
.end method

.method private getLastScheduleTime()J
    .locals 6

    .prologue
    const-wide/16 v4, 0x2710

    .line 152
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 153
    .local v0, current:J
    iget-wide v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myLastURLScheduleTime:J

    add-long/2addr v2, v4

    cmp-long v2, v2, v0

    if-gez v2, :cond_0

    .line 155
    iput-wide v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myLastURLScheduleTime:J

    .line 156
    const-wide/16 v2, 0x0

    .line 161
    :goto_0
    return-wide v2

    .line 160
    :cond_0
    iget-wide v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myLastURLScheduleTime:J

    add-long/2addr v2, v4

    iput-wide v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myLastURLScheduleTime:J

    .line 161
    iget-wide v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myLastURLScheduleTime:J

    sub-long/2addr v2, v0

    goto :goto_0
.end method

.method private notFinishedLoadForUrl(Ljava/lang/String;)V
    .locals 2
    .parameter "aURL"

    .prologue
    const/16 v1, 0x32

    .line 268
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->totalRequestCount()I

    move-result v0

    if-lt v0, v1, :cond_1

    .line 270
    iget v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myFailedUrlCount:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myFailedUrlCount:I

    .line 271
    iget v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myFailedUrlCount:I

    if-lt v0, v1, :cond_0

    .line 273
    monitor-enter p0

    .line 275
    :try_start_0
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    invoke-virtual {v0}, Ljava/util/Vector;->clear()V

    .line 276
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    invoke-virtual {v0}, Ljava/util/Vector;->clear()V

    .line 277
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRunningRequests:Ljava/util/Vector;

    invoke-virtual {v0}, Ljava/util/Vector;->clear()V

    .line 278
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->saveUrls()V

    .line 279
    const/4 v0, 0x0

    iput v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myFailedUrlCount:I

    .line 280
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    .line 281
    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    .line 273
    monitor-exit p0

    .line 293
    :goto_0
    return-void

    .line 273
    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0

    .line 286
    :cond_0
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 291
    :cond_1
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    goto :goto_0
.end method

.method private removeRunningUrl(Ljava/lang/String;)V
    .locals 1
    .parameter "aURL"

    .prologue
    .line 257
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRunningRequests:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->remove(Ljava/lang/Object;)Z

    .line 258
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->saveUrls()V

    .line 259
    return-void
.end method

.method private removeUrl(Ljava/lang/String;)V
    .locals 1
    .parameter "aURL"

    .prologue
    .line 237
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->remove(Ljava/lang/Object;)Z

    .line 238
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->saveUrls()V

    .line 239
    return-void
.end method

.method private saveUrls()V
    .locals 3

    .prologue
    .line 171
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    .line 172
    .local v0, buffer:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    monitor-enter p0

    .line 174
    :try_start_0
    iget-object v1, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    invoke-virtual {v0, v1}, Ljava/util/Vector;->addAll(Ljava/util/Collection;)Z

    .line 175
    iget-object v1, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRunningRequests:Ljava/util/Vector;

    invoke-virtual {v0, v1}, Ljava/util/Vector;->addAll(Ljava/util/Collection;)Z

    .line 176
    iget-object v1, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    invoke-virtual {v0, v1}, Ljava/util/Vector;->addAll(Ljava/util/Collection;)Z

    .line 172
    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 178
    iget-object v1, p0, Lcom/trademob/tracking/TMRequestProcessor;->myUtility:Lcom/trademob/tracking/TMUtility;

    const-string v2, "TMPersistedURLS"

    invoke-virtual {v1, v2, v0}, Lcom/trademob/tracking/TMUtility;->storeStringVector(Ljava/lang/String;Ljava/util/Vector;)V

    .line 179
    return-void

    .line 172
    :catchall_0
    move-exception v1

    :try_start_1
    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method

.method private declared-synchronized scheduleTask()V
    .locals 4

    .prologue
    .line 186
    monitor-enter p0

    :try_start_0
    iget-boolean v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTaskSet:Z

    if-nez v0, :cond_0

    .line 188
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    .line 189
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->purge()I

    .line 190
    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    .line 191
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTaskSet:Z

    .line 192
    new-instance v0, Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;-><init>(Lcom/trademob/tracking/TMRequestProcessor;Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;)V

    iput-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTask:Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;

    .line 193
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    iget-object v1, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTask:Lcom/trademob/tracking/TMRequestProcessor$TMWebViewTimerTask;

    const-wide/32 v2, 0x493e0

    invoke-virtual {v0, v1, v2, v3}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 195
    :cond_0
    monitor-exit p0

    return-void

    .line 186
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method private totalRequestCount()I
    .locals 2

    .prologue
    .line 313
    iget-object v0, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    invoke-virtual {v0}, Ljava/util/Vector;->size()I

    move-result v0

    iget-object v1, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    invoke-virtual {v1}, Ljava/util/Vector;->size()I

    move-result v1

    add-int/2addr v0, v1

    iget-object v1, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRunningRequests:Ljava/util/Vector;

    invoke-virtual {v1}, Ljava/util/Vector;->size()I

    move-result v1

    add-int/2addr v0, v1

    return v0
.end method


# virtual methods
.method public declared-synchronized loadUrl(Ljava/lang/String;)V
    .locals 2
    .parameter "aURL"

    .prologue
    .line 85
    monitor-enter p0

    :try_start_0
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->totalRequestCount()I

    move-result v0

    const/16 v1, 0x32

    if-ge v0, v1, :cond_0

    .line 87
    invoke-direct {p0, p1}, Lcom/trademob/tracking/TMRequestProcessor;->addUrl(Ljava/lang/String;)V

    .line 88
    invoke-virtual {p0}, Lcom/trademob/tracking/TMRequestProcessor;->runNextUrl()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 90
    :cond_0
    monitor-exit p0

    return-void

    .line 85
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public runNextUrl()V
    .locals 4

    .prologue
    .line 99
    iget-boolean v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTaskSet:Z

    if-nez v2, :cond_0

    .line 101
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    invoke-virtual {v2}, Ljava/util/Vector;->size()I

    move-result v2

    if-lez v2, :cond_1

    .line 103
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->getLastScheduleTime()J

    move-result-wide v0

    .line 104
    .local v0, next:J
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myTimer:Ljava/util/Timer;

    new-instance v3, Lcom/trademob/tracking/TMRequestProcessor$2;

    invoke-direct {v3, p0}, Lcom/trademob/tracking/TMRequestProcessor$2;-><init>(Lcom/trademob/tracking/TMRequestProcessor;)V

    invoke-virtual {v2, v3, v0, v1}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V

    .line 146
    .end local v0           #next:J
    :cond_0
    :goto_0
    return-void

    .line 128
    :cond_1
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    invoke-virtual {v2}, Ljava/util/Vector;->size()I

    move-result v2

    if-lez v2, :cond_2

    .line 132
    monitor-enter p0

    .line 134
    :try_start_0
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->scheduleTask()V

    .line 135
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRequests:Ljava/util/Vector;

    iget-object v3, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    invoke-virtual {v2, v3}, Ljava/util/Vector;->addAll(Ljava/util/Collection;)Z

    .line 136
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myOldRequests:Ljava/util/Vector;

    invoke-virtual {v2}, Ljava/util/Vector;->removeAllElements()V

    .line 132
    monitor-exit p0

    goto :goto_0

    :catchall_0
    move-exception v2

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2

    .line 141
    :cond_2
    iget-object v2, p0, Lcom/trademob/tracking/TMRequestProcessor;->myRunningRequests:Ljava/util/Vector;

    invoke-virtual {v2}, Ljava/util/Vector;->size()I

    move-result v2

    if-lez v2, :cond_0

    .line 143
    invoke-direct {p0}, Lcom/trademob/tracking/TMRequestProcessor;->cancelTask()V

    goto :goto_0
.end method
